package com.admin.work.service.impl;

import com.admin.common.annotation.DataScope;
import com.admin.work.domain.WorkBuyInfo;
import com.admin.work.mapper.WorkBuyInfoMapper;
import com.admin.work.service.IWorkBuyInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 购买信息 服务层处理
 * 
 * @author fzgnin
 */
@Service
public class WorkBuyInfoServiceImpl implements IWorkBuyInfoService
{
    @Autowired
    private WorkBuyInfoMapper buyInfoMapper;

    /**
     * 查询购买信息集合
     * 
     * @param buyInfo 购买信息
     * @return 购买信息集合
     */
    @Override
    @DataScope(deptAlias = "buy")
    public List<WorkBuyInfo> selectBuyInfoList(WorkBuyInfo buyInfo) {
        return buyInfoMapper.selectBuyInfoList(buyInfo);
    }

    /**
     * 通过购买ID查询购买信息
     *
     * @param buyID 购买ID
     * @return 购买对象信息
     */
    @Override
    public WorkBuyInfo selectBuyInfoByID(Long buyID) {
        return buyInfoMapper.selectBuyInfoByID(buyID);
    }

    @Override
    public int insertBuyInfo(WorkBuyInfo buyInfo) {
        return buyInfoMapper.insertBuyInfo(buyInfo);
    }

    @Override
    public int updateBuyInfo(WorkBuyInfo buyInfo) {
        return buyInfoMapper.updateBuyInfo(buyInfo);
    }
}
